package cloudgamesaumysql

import (
	"gorm.io/gorm"
	"time"
)

/*
  @author liubogeng
  @date   2025/3/6 15:31
*/

// CGGameAUFlowUserOperationRecord 云游戏流量用户操作记录表
type CGGameAUFlowUserOperationRecord struct {
	ID           int64          `json:"id" gorm:"column:id;type:bigint;primaryKey;autoIncrement;comment:ID"`
	UserID       int64          `json:"user_id" gorm:"column:user_id;type:bigint;not null;default:0;comment:用户ID"`
	Phone        string         `json:"phone" gorm:"column:phone;type:varchar(20);not null;default:'';comment:用户手机号"`
	UserIP       string         `json:"user_ip" gorm:"column:user_ip;type:varchar(20);not null;default:'';comment:用户IP"`
	ApiName      string         `json:"api_name" gorm:"index;column:api_name;type:varchar(124);not null;default:'';comment:接口名字"`
	ApiAddr      string         `json:"api_addr" gorm:"index;column:api_addr;type:varchar(500);not null;default:'';comment:接口地址"`
	ApiType      int            `json:"api_type" gorm:"index;column:api_type;type:tinyint;not null;default:0;comment:限流状态；0未限流 1已限流"`
	IsBlacklist  int            `json:"is_blacklist" gorm:"index;column:is_blacklist;type:tinyint;not null;default:0;comment:是否在黑名单；0不在黑名单 1已在黑名单"`
	ResponseCode int64          `json:"response_code" gorm:"column:response_code;type:bigint;not null;default:0;comment:响应状态码"`
	CreatedAt    time.Time      `json:"created_at" gorm:"index;column:created_at;type:datetime;comment:该条记录创建时间"`
	UpdatedAt    time.Time      `json:"updated_at" gorm:"column:updated_at;type:datetime;comment:该条记录修改时间"`
	DeletedAt    gorm.DeletedAt `json:"-" gorm:"index;type:datetime;comment:该条记录删除时间"`
}

func (CGGameAUFlowUserOperationRecord) TableName() string {
	return "cg_game_au_flow_user_operation_record"
}
